//
//  fifthTableViewCell.m
//  xiaoyiNew
//
//  Created by 讯一 on 16/12/27.
//  Copyright © 2016年 讯一. All rights reserved.
//

#import "fifthTableViewCell.h"
#import "UIButton_Segment.h"

@interface fifthTableViewCell ()

@property UIButton_Segment *btn;
@end

@implementation fifthTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self tosetui];
    }
    return self;
}

- (void)tosetui{
    self.backgroundColor = [UIColor whiteColor];
    NSArray *arrtitle2 = @[@"认证",@"购物达人",@"魅力值"];
    NSArray *arrpic2 = @[@"mypic4",@"mypic5",@"mypic6"];
    for (int i = 0; i < 3; i ++) {
        YTBaseButton *but = [[YTBaseButton alloc]initWithFrame:CGRectMake(0 + i *Screen_Width/3.0, 0, Screen_Width/3.0, Screen_Width/3.0)];
        [but setImage:[UIImage imageNamed:arrpic2[i]] forState:UIControlStateNormal];
        [but setTitle:arrtitle2[i] forState:UIControlStateNormal];
        [but setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        but.tag = 50000+i;
        [but addTarget:self action:@selector(tip:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:but];
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake( i *Screen_Width/3.0 - 2,0, 2, Screen_Width/3.0)];
        line.backgroundColor = TSColor(240, 240, 240);
        [self addSubview:line];
}
}

- (void)tip:(YTBaseButton *)button{
    if (self.delegate && [self.delegate respondsToSelector:@selector(act5:)]) {
        [self.delegate act5:button];
        NSLog(@"tag:%ld",button.tag);
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
